package com.zzedu.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.zzedu.common.annotation.Excel;
import jakarta.validation.constraints.NotNull;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 短信发送记录对象 zz_send_msg
 *
 * @author Mr.Wang
 * @date 2025-03-07
 * <p>
 * id                   bigint not null auto_increment comment 'id',
 * sms_type             varbinary(200) comment '短信类型',
 * content              varbinary(1024) comment '短信内容',
 * result               bigint comment '发送结果[0-待发送 1-发送中 2-发送失败 3-发送失败]',
 * phone                varchar(1024) comment '发送号码,多个号逗号隔开',
 * is_used              bigint comment '使用状态 0-否 1-是',
 * source_ip            varchar(50) comment '来源ip[主动请求时ip]',
 * expire_at            datetime comment '失效日期[针对验证码]',
 * gmt_create           datetime not null default CURRENT_TIMESTAMP comment '添加时间',
 * gmt_modify           datetime not null default CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP comment '更新时间',
 * deleted              int not null default 0 comment '逻辑删除(0：未删除 1：id)',
 * create_by            bigint comment '创建人',
 * update_by            bigint comment '修改人',
 * primary key (id)
 */
@TableName("zz_send_msg")
public class ZzSendMsg implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 短信类型
     */
    @Excel(name = "短信类型")
    private String smsType;

    /**
     * 短信内容
     */
    @Excel(name = "短信内容")
    private String content;

    /**
     * '发送结果[0-待发送 1-发送中 2-发送失败 3-发送成功 4-发送超未知发送结果]',
     */
    @Excel(name = "发送结果[短信平台返回结果]")
    private Integer result;

    /**
     * 发送号码
     */
    @Excel(name = "发送号码")
    private String phone;

    /**
     * 来源IP
     */
    private String sourceIp;

    /**
     * 是否使用 0-否 1-是
     */
    private Integer isUsed;
    /**
     * 失效日期[针对验证码]
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "失效日期[针对验证码]", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime expireAt;

    /**
     * 添加时间
     */
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime gmtCreate;

    /**
     * 更新时间
     */
    @TableField(fill = FieldFill.UPDATE)
    private LocalDateTime gmtModify;

    /**
     * 逻辑删除(0：未删除 1：id)
     */
    @TableLogic(delval = "id")
    @TableField(fill = FieldFill.INSERT)
    @NotNull(message = "失效日期[针对验证码]不能为空")
    private Integer deleted;

    /**
     * 创建人
     */
    @TableField(fill = FieldFill.INSERT)
    private Long createBy;

    /**
     * 修改人
     */
    @TableField(fill = FieldFill.UPDATE)
    private Long updateBy;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getSmsType() {
        return smsType;
    }

    public void setSmsType(String smsType) {
        this.smsType = smsType;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Integer getResult() {
        return result;
    }

    public void setResult(Integer result) {
        this.result = result;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getSourceIp() {
        return sourceIp;
    }

    public void setSourceIp(String sourceIp) {
        this.sourceIp = sourceIp;
    }

    public Integer getIsUsed() {
        return isUsed;
    }

    public void setIsUsed(Integer isUsed) {
        this.isUsed = isUsed;
    }

    public LocalDateTime getExpireAt() {
        return expireAt;
    }

    public void setExpireAt(LocalDateTime expireAt) {
        this.expireAt = expireAt;
    }

    public LocalDateTime getGmtCreate() {
        return gmtCreate;
    }

    public void setGmtCreate(LocalDateTime gmtCreate) {
        this.gmtCreate = gmtCreate;
    }

    public LocalDateTime getGmtModify() {
        return gmtModify;
    }

    public void setGmtModify(LocalDateTime gmtModify) {
        this.gmtModify = gmtModify;
    }

    public Integer getDeleted() {
        return deleted;
    }

    public void setDeleted(Integer deleted) {
        this.deleted = deleted;
    }

    public Long getCreateBy() {
        return createBy;
    }

    public void setCreateBy(Long createBy) {
        this.createBy = createBy;
    }

    public Long getUpdateBy() {
        return updateBy;
    }

    public void setUpdateBy(Long updateBy) {
        this.updateBy = updateBy;
    }

    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this, ToStringStyle.JSON_STYLE);
    }
}
